{include file="Public:header" /}
 <link rel="stylesheet" href="__PUBLIC__/Admin/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css" media="screen"/>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>修改管理员</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <form action="__URL__/adminEdit" method="post" id="defaultForm" class="form-horizontal">

                            <div class="form-group">
                                <label class="col-sm-2 control-label">管理组</label>
                                 <div class="col-sm-6">
                                     <select name="group_id" style="border-radius: 4px;" class="form-control">
                                         <option value="">请选择...</option>

                                         <?php foreach($user_group as $data):
                                            if($data['id'] === $userGroup['group_id'])
                                                $select = 'selected="selected"';
									        else
										        $select = '';
                                          ?>
                                         <option <?php echo $select; ?> value="{$data['id']}">{$data['title']}</option>

                                         <?php endforeach; ?>
                                     </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">用户名</label>
                                 <div class="col-sm-6">
                                    <input type="text" value="{$user['username']}" name="username" class="form-control">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">邮箱</label>
                                 <div class="col-sm-6">
                                    <input type="text" value="{$user['email']}" name="email" class="form-control">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">手机号</label>
                                <div class="col-sm-6">
                                   <input type="text" value="{$user['phone']}" name="phone" class="form-control">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">密码</label>
                                <div class="col-sm-6">
                                    <input type="text" style="border-radius: 4px;" class="form-control"  name="password" placeholder="留空表示不修改">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">确认密码</label>
                                <div class="col-sm-6">
                                    <input type="text" style="border-radius: 4px;" class="form-control"  name="confirm_password" placeholder="留空表示不修改">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>

                            <input type="hidden" name="id" value="{$user['id']}">
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button class="btn btn-primary" type="submit">保存</button>
                                    <button class="btn btn-white" type="submit">取消</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
				</div>
			</div>
		</div>
	</div>


	{include file="Public:footer" /}

	<script>
$(document).ready(function() {
    /**
     * 下面是进行插件初始化
     * 你只需传入相应的键值对
     * */
    $('#defaultForm').bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {/*输入框不同状态，显示图片的样式*/
            	  valid: 'glyphicon glyphicon-ok',
                  invalid: 'glyphicon glyphicon-remove',
                  validating: 'glyphicon glyphicon-refresh'
            },
            fields: {/*验证*/
            	prize_name: {/*键名username和input name值对应*/
                    message: '奖品名称验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '奖品名称不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 2,
                            max: 30,
                            message: '奖品名称长度必须在2到30之间'
                        }/*最后一个没有逗号*/
                    }
                },
                prize_num: {/*键名username和input name值对应*/
                    message: '奖品数量验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '奖品数量不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 1,
                            max: 30,
                            message: '奖品数量长度必须在1到30之间'
                        }/*最后一个没有逗号*/
                    }
                },
                rate: {/*键名username和input name值对应*/
                    message: '中奖概率验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '中奖概率不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 1,
                            max: 30,
                            message: '中奖概率长度必须在1到30之间'
                        }/*最后一个没有逗号*/
                    }
                },
                max_winning:{/*键名username和input name值对应*/
                    message: '每天最多中奖数量验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '每天最多中奖数量不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 1,
                            max: 30,
                            message: '每天最多中奖数量长度必须在1到30之间'
                        }/*最后一个没有逗号*/
                    }
                }
               
            }
            // 还有一个比较常用的就是submitHandler属性，它对应着提交按钮的事件方法。
            // submitHandler: function (validator, form, submitButton) {
                //alert("submit");
               /*  var menu_name = $("input[name='menu_name']").val();
                var link = $("input[name='link']").val();
                var ico = $("input[name='ico']").val();
                $.ajax({
                    url : '__URL__/addMenu',
                    type : 'get',
                    data : {'menu_name' : menu_name, 'link' : link, 'ico':ico},
                    dataType : 'json',
                    success : function(data){
                      alert(data.message);
                    }
                }); */
           // }
        });
});

</script>

<script type="text/javascript" src="__PUBLIC__/Admin/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>

<script type="text/javascript">
        $('#datetimepicker6').datetimepicker({
             language:  'zh-CN',
             format: 'yyyy-mm-dd HH:ii',
             autoclose:true//日期选择完成后是否关闭选择框
        });
        $('#datetimepicker7').datetimepicker({
            language:  'zh-CN',
            format: 'yyyy-mm-dd HH:ii',
            autoclose:true //Important! See issue #1075
        });
   
</script>

</body>
</html>
